{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "文档给的例子\n",
    "\n",
    "```powershell\n",
    "conda activate fastchat\n",
    "wget https://raw.githubusercontent.com/hwchase17/langchain/v0.0.200/docs/modules/state_of_the_union.txt\n",
    "python -m fastchat.serve.controller\n",
    "python -m fastchat.serve.model_worker --model-names \"gpt-3.5-turbo,text-davinci-003,text-embedding-ada-002\" --model-path lmsys/vicuna-7b-v1.3\n",
    "python -m fastchat.serve.openai_api_server --host localhost --port 8000\n",
    "\n",
    "# 以下设置其实没有用\n",
    "setx OPENAI_API_KEY EMPTY\n",
    "setx OPENAI_API_BASE http://localhost:8000/v1\n",
    "\n",
    "pip install --upgrade --force-reinstall flask-sqlalchemy sqlalchemy\n",
    "pip install chardet\n",
    "pip install chromadb\n",
    "pip install tiktoken\n",
    "pip install sentence-transformers\n",
    "```\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "后台选用不同的模型\n",
    "\n",
    "```powershell\n",
    "python -m fastchat.serve.controller\n",
    "# token 非常长\n",
    "python -m fastchat.serve.model_worker --model-names \"gpt-3.5-turbo,text-davinci-003,text-embedding-ada-002\" --model-path lmsys/longchat-7b-16k\n",
    "# 不太成功\n",
    "python -m fastchat.serve.model_worker --model-names \"gpt-3.5-turbo,text-davinci-003,text-embedding-ada-002\" --model-path  FlagAlpha/Llama2-Chinese-13b-Chat\n",
    "python -m fastchat.serve.openai_api_server --host localhost --port 8000\n",
    "```"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "langchain",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.13"
  },
  "orig_nbformat": 4
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
